In computer programming, a procedure or test program commonly referred to as a “unit test” is often used to validate that a particular method is working properly. The method is typically a module of source code. A unit test includes test cases for functions and methods which allow a developer to analyze how the method handles different scenarios. Whenever a developer wants to test a method, the developer can write a unit test to do so.
A unit test handles, for example, “sunshine scenarios” where all inputs and return values provided to the method are as expected. The unit test also handles some exceptions, where the inputs or return values are not as expected, to insure that the method will handle those scenarios properly. Thus, the unit test can be a valuable tool in the validation of software under development.
Making the unit test of a method usually means repeating similar tests with different values. This is done to ensure that the method works as intended with boundary values and handles error situations gracefully. However, this typically requires that the developer who creates the unit test will write numerous embodiments of similar code to handle the various scenarios. Preparation of a unit test can be very time consuming. Even with copying of code, repeating the effort numerous times to handle the various scenarios adds to the time consuming nature of the task. Further, keeping the numerous embodiments of the similar code updated is often an even more tedious and time consuming task.
Developers also have to ensure that the relevant pattern is fully tested. Since the pattern is repeated throughout the tests, this can be hard to recognize. This can be due to the fact that the knowledge for the pattern is scattered throughout the different embodiments of the unit test code.
The discussion above is merely provided for general background information and is not intended to be used as an aid in determining the scope of the claimed subject matter.